package jwdt.common.interceptor;

import jwdt.common.util.StringUtil;

import com.ezerg.db.Jdb;
import com.ezerg.web.Form;
import com.ezerg.web.Interceptor;
import com.ezerg.web.Module;

public class FrontInterceptor implements Interceptor {

	public final String select_news = " SELECT id, title, titlecolor, titleface, updatetime, picname, istop, goodnews, daodu,TO_DAYS(NOW())-TO_DAYS(updatetime)<3 AS n,content,author FROM t_news ";
	public final String order_news = " ORDER BY Sequence DESC, updatetime DESC ";

	@Override
	public Object intercept(Form f, Module m) throws Exception {
		//专家团队（goodnews）
		String sql = select_news + " WHERE typeid in(36,38) and checked=1 and goodnews=1 " + order_news + " limit 4";
		f.add("zjtd", Jdb.get().query(sql));
		// 增加全局系统定义
		f.add("su", StringUtil.get());
		
		return null;
	}

}
